{extend name='public/base'}
{block name='content'}
<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        {$item['item1']}
        <small>{$item['item2']}</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> {$item['item1']}</a></li>
        <li class="active">{$item['item2']}</li>
    </ol>
</section>

<!-- Main content -->
<section class="content">
    <div class="row" >
        <div class="col-xs-12">
            <!-- /.box -->
            <div class="box">
                <div class="box-header">
                    <h3 class="box-title">列表</h3>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <table class="layui-hide"  id='test' lay-filter="test"></table>
                    <script type="text/html" id="indexTpl">
                        {{d.LAY_TABLE_INDEX+1}}
                    </script>
                    <script type="text/html" id="headimgurl">
                        {{d.headimgurl}}
                    </script>
                    <script type="text/html" id="usertype">
                        {{# if (d.usertype=== 0) { }}
                             <span>网站注册</span>
                        {{# } else if(d.usertype=== 1) { }}
                            <span>微信用户</span>
                        {{# } else { }}
                            <span>qq用户</span>
                        {{# } }}
                    </script>
                    <script type="text/html" id="barDemo">
                        <a class="layui-btn layui-btn-xs" onclick="lotus_show('编辑轮播图','show_user.html?id={{d.id}}',500,550)">查看</a>
                    </script>
                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->
        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
</section>
<!-- /.content -->
{/block}


{block name='script'}
<script>
    //增加表格数据
    $(function (){
        layui.use('table', function() {
            var table = layui.table
            cols = [
                {type: 'checkbox',width:50}
                ,{field:'id',title: '序号',toolbar: '#indexTpl',width:80}
                ,{field:'headimgurl', title:'头像',toolbar: '#headimgurl',width:150}
                ,{field:'usertype', title:'类型',toolbar: '#usertype',width:100}
                ,{field:'nickname', title:'昵称',width:100}
                ,{field:'phone', title:'手机',width:150}
                ,{field:'address', title:'地址',width:220}
                ,{field:'loginnum', title:'登录次数',width:100}
                ,{field:'datetime', title:'最后登录时间',  sort: true,width:180}
                ,{title:'操作', toolbar: '#barDemo'}
            ]
            w_layuiTable('#test','get_table_data',cols)
        })
    })
</script>
{/block}